package com.synjones.zeus.model.ykt.pay;

/**
 * 支付方式
 * @author Think 2018/4/26 17:16
 */
public enum PayType {

    _0("0", "人脸识别支付"),
    _1("1", "密码支付"),
    _2("2","卡支付");

    private final String code;// 状态码
    private final String desc;// 状态码描述

    PayType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String code() {
        return code;
    }

    public String desc() {
        return desc;
    }

    /**
     * *
     * 根据code获取描述
     *
     * @param code
     * @return
     */
    public static String getDesc(String code) {
        for (PayType info : PayType.values()) {
            if (code.equals(info.code)) {
                return info.desc;
            }
        }
        return null;
    }

}
